package day6;

import java.util.*;

public
class TestIterator {
    public static
    void main(String[] args) {
        List<String> list=new ArrayList();
        Set<String> set=new HashSet<>();
       Map<String,String> map=new HashMap<>();
        list.add("java");
        list.add("php");
        list.add("python");
        list.add("c++");
        System.out.println("-------标准for----------");
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
        System.out.println("-------增强for(迭代器)----------");
        for (String s:list){
            System.out.println(s);
        }
        System.out.println("-------迭代器----------");
        Iterator<String> it=list.iterator();
        while (it.hasNext()){
            System.out.println(it.next());
        }
    }
}
